import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/register',
    name: 'register',
    component: () => import( '@/views/register'),
    meta: {
      title: '注册'
    } 
  },
  {
    path: '/download',
    name: 'download',
    component: () => import( '@/views/download'),
    meta: {
      title: 'APP下载'
    }
  }
]




const router = new VueRouter({
  routes
})

router.beforeEach(async(to, from, next) => {
  document.title = to.meta.title
  next()
})

export default router
